#include "threaddetect.h"

#include <QDebug>

ThreadDetect::ThreadDetect()
{
    m_adb = new UtilADB();
}

void ThreadDetect::run()
{
    bool b_needRefresh = false;

    while(1)
    {
        m_retCur = m_adb->PrepareADB(&m_adbCnt);
        if(m_retCur != m_retOld)
        {
            m_retOld = m_retCur;
            b_needRefresh = true;
        } else {
            b_needRefresh = false;
        }
        emit(signal_adbDetect(m_adbCnt, b_needRefresh));
        sleep(1);
    }
}
